package writtenexamination.io;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author cyt
 * @create 2020-09-21 上午 9:50
 */
public class Tb {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] ints = new int[100];
        int i = 0;
        while (sc.hasNextInt()) {
            ints[i++] = sc.nextInt();
        }
        System.out.println(lengthOfLIS(ints));
    }

    public static int lengthOfLIS(int[] nums) {
        int len = nums.length;
        if (len < 2) {
            return len;
        }
        int[] dp = new int[len];
        Arrays.fill(dp, 1);
        for (int i = 1; i < len; i++) {
            for (int j = 0; j < i; j++) {
                if (nums[j] < nums[i]) {
                    dp[i] = Math.max(dp[i], dp[j] + 1);
                }
            }
        }
        int res = 0;
        for (int i = 0; i < len; i++) {
            res = Math.max(res, dp[i]);
        }
        return res;
    }
}
